<template>
  <div class="test-container">
    <ImageLoader
      :src="src"
      :placeholder="placeholder"
      :duration="3000"
      @loaded="changeImg"
    />
  </div>
</template>

<script>
import ImageLoader from "./";
export default {
  components: {
    ImageLoader,
  },
  data() {
    return {
      src: "https://images.pexels.com/photos/33109/fall-autumn-red-season.jpg?fit=crop&crop=entropy&w=3456&h=2304",
      placeholder:
        "https://images.pexels.com/photos/33109/fall-autumn-red-season.jpg?w=100",
    };
  },
  methods: {
    changeImg() {
      //图片加载完成后干想干的事
    },
  },
};
</script>

<style scoped>
.test-container {
  width: 500px;
  height: 400px;
  border: 2px solid black;
  margin: 0 auto;
}
</style>